﻿using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace HenIT.IO
{
    public partial class FileCopyProgress : Form
    {
        public FileCopyProgress()
        {
            InitializeComponent();
        }



        #region Properties
        public string ActionFromText
        {
            get { return lblActionFrom.Text; }
            set { lblActionFrom.Text = value; }
        }

        public string ActionToText
        {
            get { return lblActionTo.Text; }
            set { lblActionTo.Text = value; }
        }

        public int ProgressPercent
        {
            get { return progressBarCopy.Value; }
            set
            {
                progressBarCopy.Value = value;
                lblPercent.Text = value.ToString() + "%";
                System.Windows.Forms.Application.DoEvents();
            }
        }

        private bool aborted = false;
        public bool Aborted
        {
            get { return aborted; }
            set { aborted = value; }
        }

        private string titleText = "File copy progress";
        public string TitleText
        {
            get { return titleText; }
            set
            {
                titleText = value;
                this.Text = value;
            }
        }
        #endregion

        public void SetKBCopied(int kbCopied)
        {
            lblKBCopied.Text = kbCopied.ToString();
            Text = titleText + " - " + kbCopied.ToString();
        }

        private void cmdAbort_Click(object sender, EventArgs e)
        {
            aborted = true;
        }
    }
}
